import http from '@/common/js/httpRequest'

//获取版本
export function getVersion (data) {
  return http({
    method: 'post',
    url: '/api/check/aux/versions',
    data
  })
}

//获取当前版本
export function getCurrentVersion (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/version/current',
    params
  })
}

//获取zcList
export function getZcList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/zclist/one',
    params
  })
}

//获取消息数量
export function getMsgCount () {
  return http({
    method: 'get',
    url: '/api/check/aux/msg/count'
  })
}

//获取消息
export function getMsgInfo () {
  return http({
    method: 'get',
    url: '/api/check/aux/msg/info'
  })
}

//获取首页count
export function getCount () {
  return http({
    method: 'get',
    url: '/api/check/aux/count'
  })
}

//获取请验类型
export function getCheckTypes () {
  return http({
    method: 'get',
    url: '/api/check/aux/type/list'
  })
}

//获取取样样品细分类别
export function getSubdivideList () {
  return http({
    method: 'get',
    url: '/api/check/aux/subdivide/list'
  })
}

//获取单位
export function getUnitList () {
  return http({
    method: 'get',
    url: '/api/check/aux/unit/list'
  })
}

//获取完整包装规格
export function getFullSpec (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/fullspec/list',
    params
  })
}

//删除完整包装规格
export function deleteFullSpec (id) {
  return http({
    method: 'post',
    url: `/api/check/aux/fullspec/delete?id=${id}`,
    openDefultdata: true
  })
}

//获取原辅包包装容器
export function getPackContainerList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/packcontainer/list',
    params
  })
}

//获取原辅包请检目的
export function getCheckPurposeList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/checkpurpose/list',
    params
  })
}

//获取原辅包随货文件
export function getFollowFileList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/followfile/list',
    params
  })
}
//获取原辅包历史包装规格
export function getProductPackSpecByProductId (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/productpackspec/list',
    params
  })
}

//获取user基本信息
export function getUserList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/user/list',
    params
  })
}

//获取供应商基本信息
export function getSupplierList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/supplier/list',
    params
  })
}

//获取生产商基本信息
export function getManufacturerList () {
  return http({
    method: 'get',
    url: '/api/check/aux/manufacturer/list'
  })
}

//获取包装状况
export function getPackStatusList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/packstatus/list',
    params
  })
}

//获取包装异常
export function getPackExceptionList (params) {
  return http({
    method: 'get',
    url: '/api/check/aux/packexception/list',
    params
  })
}

//获取工序
export function getProcedureList () {
  return http({
    method: 'get',
    url: '/api/check/aux/procedure/list'
  })
}

//获取车间
export function getWorkshopList () {
  return http({
    method: 'get',
    url: '/api/check/aux/workshop/list'
  })
}

//获取水取样量名list
export function getWaterQuantityList () {
  return http({
    method: 'get',
    url: '/api/check/aux/waterquantity/list'
  })
}

//获取所有检验项byCheckId
export function getItemsByCheckId (params) {
  return http({
    method: 'get',
    url: '/api/check/process/itemsByCheckId',
    params
  })
}

//请验
export function registCheck (data) {
  let url = data.checkList.checkId ? '/api/check/process/regist/re' : '/api/check/process/regist'
  return http({
    method: 'post',
    url: url,
    data,
    openDefultdata: true
  })
}

//请验同一批号的第二次及以后留样单
export function registParasite (data) {
  let url = data.checkList.checkId ? '/api/check/process/regist/parasite/re' : '/api/check/process/regist/parasite'
  return http({
    method: 'post',
    url: url,
    data,
    openDefultdata: true
  })
}

//获取请验填充数据
export function getRegistCheckInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/reregist',
    params
  })
}

//获取上一单数据
export function getLastCheckForRegist (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/last/regist',
    params
  })
}

//获取上一单取样数据
export function getLastCheckForGet (data) {
  return http({
    method: 'post',
    url: '/api/check/process/info/last/get',
    data: data,
    openDefultdata: true
  })
}

//获取上一单分发数据
export function getLastCheckForDispense (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/last/dispense',
    params
  })
}

//获取上一单填写数据
export function getLastCheckForWrite (data) {
  return http({
    method: 'post',
    url: '/api/check/process/info/last/write',
    data: data,
    openDefultdata: true
  })
}

//获取小组填写的最后一个项目
export function getInspectionGroupLastOptItem (params) {
  return http({
    method: 'get',
    url: '/api/check/process/lastitem/info',
    params
  })
}

//获取list
export function checkList (params) {
  return http({
    method: 'get',
    url: '/api/check/process/list',
    params
  })
}
//通过标准信息获得
export function queryList4standUpdate (params) {
  return http({
    method: 'get',
    url: '/api/check/process/list4standUpdate',
    params
  })
}

//获取merge_list
export function checkMergeList (params) {
  return http({
    method: 'get',
    url: '/api/check/process/list/merge',
    params
  })
}

//获取所有checkLists
export function getCheckListsByShowCheckId (params) {
  return http({
    method: 'get',
    url: '/api/check/process/lists',
    params
  })
}

//获取list by checkId
export function getListByCheckId (params) {
  return http({
    method: 'get',
    url: '/api/check/process/list/one',
    params
  })
}

//获取checkInfo
export function getCheckInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info',
    params
  })
}

//获取分发所需数据
export function getDispenseInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/dispense',
    params
  })
}

//获取结论所需数据
export function getUpdateItemInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/updateitem',
    params
  })
}

//获取结论所需数据
export function getVerdictInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/verdict',
    params
  })
}

//获取放行所需数据
export function getPassInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/pass',
    params
  })
}

//取样
export function get (data) {
  let url = data.getList == null ? '/api/check/process/get/re' : '/api/check/process/get'
  return http({
    method: 'post',
    url: url,
    data,
    openDefultdata: true
  })
}

//获取水取样量信息
export function getYsQuantityInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/ys',
    params
  })
}

//收样
export function receive (data) {
  return http({
    method: 'post',
    url: '/api/check/process/receive',
    data,
    openDefultdata: true
  })
}

//分发
export function dispense (data) {
  return http({
    method: 'post',
    url: '/api/check/process/dispense',
    data,
    openDefultdata: true
  })
}

//修改分样时间
export function updateReceiveAndDispenseTime (data) {
  return http({
    method: 'post',
    url: '/api/check/process/dispense/update',
    data,
    openDefultdata: true
  })
}

//小组领取
export function groupGet (data) {
  return http({
    method: 'post',
    url: '/api/check/process/get/group',
    data,
    openDefultdata: true
  })
}

//小组填写row
export function groupWrite (data) {
  return http({
    method: 'post',
    url: '/api/check/process/write/group',
    data,
    openDefultdata: true
  })
}

//下总结论
export function verdict (data) {
  return http({
    method: 'post',
    url: '/api/check/process/verdict',
    data,
    openDefultdata: true
  })
}

//收到报告书
export function reportGet (data) {
  return http({
    method: 'post',
    url: '/api/check/process/get/report',
    data,
    openDefultdata: true
  })
}

//放行
export function pass (data) {
  return http({
    method: 'post',
    url: '/api/check/process/pass',
    data,
    openDefultdata: true
  })
}

//确认
export function confirm (data) {
  return http({
    method: 'post',
    url: '/api/check/process/confirm',
    data,
    openDefultdata: true
  })
}

//获取放行所需数据
export function getPass (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/pass/one',
    params
  })
}

//获取小组填写所需数据
export function getGroupWriteInfo (data) {
  return http({
    method: 'post',
    url: '/api/check/process/info/write/group',
    data
  })
}

//退回
export function returnCheck (data) {
  return http({
    method: 'post',
    url: '/api/check/process/return',
    data
  })
}

//作废
export function cancelCheck (data) {
  return http({
    method: 'post',
    url: '/api/check/process/cancel',
    data
  })
}

//撤回结论
export function recallVerdict (data) {
  return http({
    method: 'post',
    url: '/api/check/process/recall',
    data
  })
}

//撤回放行
export function recallPass (data) {
  return http({
    method: 'post',
    url: '/api/check/process/recall/pass',
    data
  })
}

//半路打印保存相关信息
export function saveHalf (data) {
  return http({
    method: 'post',
    url: '/api/check/process/half/save',
    data
  })
}

//分样之前修改item
export function updateItem (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/update',
    data
  })
}

//修改checkItem组
export function updateCheckItemGroup (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/group/update',
    data,
    openDefultdata: true
  })
}

//分样之后add item
export function addItemAfterDispense (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/add',
    data
  })
}

//分样之后add item
export function deleteItemAfterDispense (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/delete',
    data
  })
}

//修改list内容
export function updateListContentForGod (data) {
  return http({
    method: 'post',
    url: '/api/check/process/god/list',
    data
  })
}

//修改yfb内容
export function updateYfbContentForGod (data) {
  return http({
    method: 'post',
    url: '/api/check/process/god/yfb',
    data
  })
}

//修改zc内容
export function updateZcContentForGod (data) {
  return http({
    method: 'post',
    url: '/api/check/process/god/zc',
    data
  })
}

//修改list内容
export function updateListContentForUpdateMode (data) {
  return http({
    method: 'post',
    url: '/api/check/process/update/list',
    data
  })
}

//修改yfb内容
export function updateYfbContentForUpdateMode (data) {
  return http({
    method: 'post',
    url: '/api/check/process/update/yfb',
    data
  })
}

//修改zc内容
export function updateZcContentForUpdateMode (data) {
  return http({
    method: 'post',
    url: '/api/check/process/update/zc',
    data
  })
}

//获取小组填写所需数据
export function getPrintDisInfo (params) {
  return http({
    method: 'get',
    url: '/api/check/process/info/print/dispense',
    params
  })
}

//获取请验历史数据
export function getHistoryByRegist (params) {
  return http({
    method: 'get',
    url: '/api/check/process/history/regist',
    params
  })
}

//获取绩效表
export function getPerformanceList (params) {
  return http({
    method: 'get',
    url: '/api/check/performance/performances',
    params
  })
}

//发起绩效
export function saveCheckPerformances (data) {
  return http({
    method: 'post',
    url: '/api/check/performance/save',
    data,
    openDefultdata: true
  })
}

//填写绩效
export function performanceWrite (data) {
  return http({
    method: 'post',
    url: '/api/check/performance/write',
    data,
    openDefultdata: true
  })
}

//获取微生物限度，无菌项目的检验预计时间以及相关台账
export function getItemTimeBook (params) {
  return http({
    method: 'get',
    url: '/api/check/book/item/time',
    params
  })
}

//开始检验项目
export function startInspectionItem (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/start',
    data,
    openDefultdata: true
  })
}

//判定项目
export function verdictItem (data) {
  return http({
    method: 'post',
    url: '/api/check/process/item/verdict',
    data,
    openDefultdata: true
  })
}

//初始化parasite
export function printParasiteInit (data) {
  return http({
    method: 'post',
    url: '/api/check/process/init/parasite',
    data,
    openDefultdata: true
  })
}

//刷新所有请验单状态
export function flushCheckStatus (data) {
  return http({
    method: 'post',
    url: '/api/check/process/status/flush',
    data
  })
}

//强制完成工序
export function finishMergeList (data) {
  return http({
    method: 'post',
    url: '/api/check/process/merge/finish',
    data
  })
}

//检查是否含有重复批号
export function checkBatchNum (params) {
  return http({
    method: 'get',
    url: '/api/check/process/check/batchnum',
    params
  })
}

// 修改check_list的print_pass_number 为现在版本
export function updateCheckListsPrintPassNumberForCurrent(data) {
  return http({
    method: 'post',
    url: '/api/check/process/update/print/pass/number',
    data
  })
}

// 获取修改标准的相关信息by check_merge_id
export function getChangeStandardInfoByMergeId(params) {
  return http({
    method: 'get',
    url: '/api/check/process/changestandard/info',
    params
  })
}

// 修改标准
export function changeStandard(data) {
  return http({
    method: 'post',
    url: '/api/check/process/changestandard/update',
    data,
    openDefultdata: true
  })
}

// 消除通知
export function iknow (id) {
  return http({
    method: 'post',
    url: `/api/check/aux/msg/delete?id=${id}`,
    openDefultdata: true
  })
}

// 设置已经放行打印过
export function setPassPrintStatus (ids) {
  return http({
    method: 'post',
    url: '/api/check/process/pass/print/status',
    data: ids,
    openDefultdata: true
  })
}

// 上传至钉钉
export function uploadToDingTalk (data) {
  return http({
    method: 'post',
    url: '/api/ding/upload',
    data,
    openDefultdata: true
  })
}
